/*******************************************************************************
 * 框架页相关功能函数
 *******************************************************************************/
 
var win = null;

function resizeframe(direction) {
	var main_body = self.parent.document.getElementById('main_body');
	var w_array = main_body.cols.split(",");

	if(direction == 'right') {
		w_array[0] = parseInt(w_array[0]) - 100;
		if(w_array[0] < 0){
			w_array[0] = 0;
		}
	} else {
		w_array[0] = parseInt(w_array[0]) + 100;
		if(w_array[0] > 1000){
			w_array[0] = 1000;
		}
	}
	var w_string = w_array[0];
	for(var i = 1; i < w_array.length; i ++){
		w_string += ',' + w_array[i];
	}
	main_body.cols = w_string;
}

function shleft(width){
	var main_body = self.parent.document.getElementById('main_body');
	var w_array = main_body.cols.split(",");
	w_array[1] = width;
	var w_string = w_array[0];
	for(var i = 1; i < w_array.length; i ++){
		w_string += ',' + w_array[i];
	}
	main_body.cols = w_string;
}

// 显示或隐藏左边导航栏
function sh_nav(){
	var main_body = self.parent.document.getElementById('main_body');
	var w_array = main_body.cols.split(",");

	if(w_array[0] == 0){
		w_array[0] = 200;
		//w_array[1] = '*';
	}else{
		w_array[0] = 0;
		//w_array[1] = '*';
	}

	var w_string = w_array[0];
	for(var i = 1; i < w_array.length; i ++){
		w_string += ',' + w_array[i];
	}
	main_body.cols = w_string;
}

// 切换到编辑窗口
function iore(){
	win = top.frames['eBody'];

	var main_body = self.parent.document.getElementById('main_body');
	var w_array = main_body.cols.split(",");

	//if(w_array[4] == 0){
		w_array[1] = 0;
		w_array[2] = '*';
	//}

	var w_string = w_array[0];
	for(var i = 1; i < w_array.length; i ++){
		w_string += ',' + w_array[i];
	}
	main_body.cols = w_string;
}

// 切换到列表窗口
function eori(){
	win = top.frames['iBody'];

	var main_body = self.parent.document.getElementById('main_body');
	var w_array = main_body.cols.split(",");

	//if(w_array[3] == 0){
		w_array[2] = 0;
		w_array[1] = '*';
	//}

	var w_string = w_array[0];
	for(var i = 1; i < w_array.length; i ++){
		w_string += ',' + w_array[i];
	}
	main_body.cols = w_string;
}

// 将编辑窗口作为收集窗口
function iorg(){
	var main_body = self.parent.document.getElementById('main_body');
	var w_array = main_body.cols.split(",");
	w_array[1] = '*';
	w_array[2] = '160';
	var w_string = w_array[0];
	for(var i = 1; i < w_array.length; i ++){
		w_string += ',' + w_array[i];
	}
	main_body.cols = w_string;
}

// 将编辑窗口作为收集窗口
function gori(){
	var main_body = self.parent.document.getElementById('main_body');
	var w_array = main_body.cols.split(",");
	w_array[1] = '*';
	w_array[2] = '0';
	var w_string = w_array[0];
	for(var i = 1; i < w_array.length; i ++){
		w_string += ',' + w_array[i];
	}
	main_body.cols = w_string;
}

// 返回当前窗口状态，列表或编辑
function getMode(){
	var main_body = self.parent.document.getElementById('main_body');
	var w_array = main_body.cols.split(",");
	if(w_array[3] == 0){
		return 'edit';
	}else{
		return 'list';
	}
}